﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Profile;

namespace WebSite.admin.system
{
    public partial class shop_config05 : BaseAdmin
    {


        // Methods
        private void Bind()
        {
            string sql = "select top 1 * from DB_Shopconfig where isnull(shopid,0)=" + base.AdminShopId;
            DataTable table = new DataTable();
            table = SQLAccess.GreatDs(sql).Tables[0];
            this.shopshowcode.SelectedValue = table.Rows[0]["shopshowcode"].ToString();
            this.shopshowpai.SelectedValue = table.Rows[0]["shopshowpai"].ToString();
            this.shopshoweight.SelectedValue = table.Rows[0]["shopshoweight"].ToString();
            this.shopshowku.SelectedValue = table.Rows[0]["shopshowku"].ToString();
            this.shopshowvisible.SelectedValue = table.Rows[0]["shopshowvisible"].ToString();
            this.shopstyle.SelectedValue = table.Rows[0]["shopstyle"].ToString();
            this.shopshowstore.SelectedValue = table.Rows[0]["shopshowstore"].ToString();
        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            SQLAccess.DoSql("update DB_Shopconfig set shopshowcode=" + re.replace(this.shopshowcode.SelectedValue) + ",shopshowpai=" + re.replace(this.shopshowpai.SelectedValue) + ",shopshoweight=" + re.replace(this.shopshoweight.SelectedValue) + ",shopshowku=" + re.replace(this.shopshowku.SelectedValue) + ",shopshowvisible=" + re.replace(this.shopshowvisible.SelectedValue) + ",shopstyle=" + re.replace(this.shopstyle.SelectedValue) + ",shopshowstore=" + re.replace(this.shopshowstore.SelectedValue) + " where shopid=" + base.AdminShopId);
            base.Response.Write("<script language='javascript'>window.location.href='shop_config05.aspx';</script>");
            base.Response.End();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Session["Adminlogin"] == null)
            {
                base.Response.Write("<script language=javascript>window.top.location.href='../login.aspx';</script>");
                base.Response.End();
            }
            if (!base.IsPostBack)
            {
                this.Bind();
            }
        }


    }
}